<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title></title>
	</head>
	<body>
	</body>
	<script type="text/javascript"
		src="https://cdn.jsdelivr.net/npm/@idealight-labs/anyweb-js-sdk@1.3.2/dist/anyweb-js-sdk.umd.min.js">
	</script>
	<script type="text/javascript" src="https://gitee.com/dcloud/uni-app/raw/dev/dist/uni.webview.1.5.4.js"></script>
	<script type="text/javascript">
		let provider = new window.AnyWeb.Provider({
			logger: console,
			appId: 'ed6f4342-3a51-4b87-bd47-02ff13a04962',
		})
		// 登陆
		provider.on('ready', async () => {
			let res = await provider.request({
				method: 'cfx_accounts',
				params: [{
					availableNetwork: [1, 1029],
					scopes: ['baseInfo', 'identity'],
				}, ]
			})
			// 登陆成功
			console.log('res', JSON.stringify(res))
			// 发送数据
			uni.postMessage({
				data: {
					anyWebInfo: res
				}
			});
			uni.switchTab({
				url: '/pages/My/My'
			})
		})
	</script>
</html>
